<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
    <s:set id="shopPrice" value="2.5"/> <!-- 定义商品单价 -->
 <s:set id="quantity" value="15"/> <!-- 定义购买数量 -->
 <s:set id="grade" value="3"/> <!-- 定义会员级别 -->
 <s:if test="#grade==1"> <!-- 如果一级会员，打0.9折 -->
     <s:set id="discount" value="0.9"/> 
  </s:if>
  <s:elseif test="#grade==2"> <!-- 否则如果二级会员，打0.8折 -->
      <s:set id="discount" value="0.8"/>
  </s:elseif>
  <s:elseif test="#grade==3"> <!--否则如果三级会员，打0.8折 -->
      <s:set id="discount" value="0.7"/>
  </s:elseif>  
  <s:else> <!--否则不打折 -->
     <s:set id="discount" value="1"/>
  </s:else>
 <s:set id="mustPay" value="#quantity*#shopPrice*#discount"/>
  会员购买信息如下：<hr/>
  会员级别：<s:property value="#grade"/>级<br/>
  商品单价：<s:property value="#shopPrice"/>元<br/> 
  购买数量：<s:property value="#quantity"/><br/>
  应付款：<s:property value="#mustPay"/>元<hr/>   
    
</body>
</html>